
#include "HttpCmdGetVersion.h"
#include "SysInfo.h"


CHttpCmdGetVersion::CHttpCmdGetVersion()
{

}


CHttpCmdGetVersion::~CHttpCmdGetVersion()
{

}

bool CHttpCmdGetVersion::CheckParamVaild(const std::string &strReqMessage)
{
    return true;
}

bool CHttpCmdGetVersion::FillRspData(std::string &strRspData)
{
    // need some system helper functions
    neb::CJsonObject rspJsonObj;
    rspJsonObj.AddEmptySubObject("Data");
    neb::CJsonObject &dataJsonObj = rspJsonObj["Data"];

    std::string strCompileDate, strCompileTime;
    CSysInfo::GetCompileDateTime(strCompileDate, strCompileTime);
    dataJsonObj.Add("Compile Date", strCompileDate);
    dataJsonObj.Add("Compile Time", strCompileTime);


    std::string strGitVersion, strGitBranch;
    CSysInfo::GetVersion(strGitVersion, strGitBranch);
    dataJsonObj.Add("Git Branch", strGitBranch);
    dataJsonObj.Add("Git Version", strGitVersion);    

    strRspData = rspJsonObj.ToString();
}

